package cn.ift8.spring.aop;

import org.aspectj.lang.ProceedingJoinPoint;

/**
 * Created by IFT8
 * on 2015/8/18.
 */
public class Privilege {
    private String access;

    public String getAccess() {
        return access;
    }

    public void setAccess(String access) {
        this.access = access;
    }

    public void check(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("check privilege……");
        if ("pass".equals(access)) {
            //方法名输出
            System.out.println("执行切点方法： " + joinPoint.getSignature().getName());
            //执行切点(目标类方法)
            joinPoint.proceed();
        } else {
            System.out.println("权限不足");
        }
    }
}
